<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class C_Usuario extends MY_Controller {

	function __construct() {
            
            parent::__construct();
            $this->load->helper('html');
            $this->load->helper('url');

	}

        function novoUsuario(){
           
            $user = new models\Usuario;
          
            
            $user->setNomeUser(strtolower($nome));
            $user->setSenhaUser(crypt($senha));
            $user->setPerfilUser(1);
            
            $this->em->persist($user);

            $this->em->flush();
            
            
            echo TRUE;
            
        }
        
        function senhaCript(){

            $msg = "bzinha";
           
            $hash = crypt($msg);
                        
            echo ">>>".strlen($hash)."<br />";
            echo ">>>".$hash."<br />";
            
            if(crypt($msg,$hash) == $hash) echo "Entendi";
           
            
        }
}